import React from 'react'
import { useNavigate } from 'react-router-dom';

import '../index.css'
const Car = ({info}) => {
    let navigate=useNavigate()
console.log(info);
const carlist=(id)=>{
    navigate(`/detail/${id}`)
    
}
  return (
    <div>
           <div className='wrap1' onClick={()=>carlist(info.id)}>
            <img src={info.master_diagram} alt=""  className='img'/>
            <div className='nam'>
                {info.name}
            </div>
            <div className='pric'>
               ￥{info.price}
               
                
            </div>
            </div>
    </div>
  )
}

export default Car